#ifndef MYCAMERATEST
#define MYCAMERATEST
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.01745329251994329576923690768489

#include <windows.h>
#include <d3d10.h>
#include <d3dx10.h>
#include "hrTimer.h"
class Camera
{
	/*******************************************************************
	* Members
	********************************************************************/	
private:
	//window handle
	HWND*						hWnd;
	//projection and view matrices
	//view parameters
	float heading, pitch;					//in radians
	float headingIncrement, pitchIncrement;	//in radians
	//matrices
	D3DXMATRIX viewMatrix;
	D3DXMATRIX projectionMatrix;
	D3DXMATRIX rotationMatrix;

	//view vectors
	const D3DXVECTOR3 dV, dU;				//default view and up vectors
	D3DXVECTOR3 eye, view, up;

	//movement vectors and movement toggles
	D3DXVECTOR3 forward, strafeRight;
	int movementToggles[4];					//fwrd, bck, strfLft, strfRght
	int pitchrollToggles[4];				//Up, Down, Left, Right
	timer camTimer;
	/*******************************************************************
	* Methods
	********************************************************************/	
public:

	//constructor and destructor
	Camera();
	~Camera();

	//initialize directx device
	bool initialize(HWND*);
	D3DXMATRIX *getViewMatrix();
	D3DXMATRIX *getProjectionMatrix();
	void moveForwardOn();
	void moveBackwardOn();
	void moveRightOn();
	void moveLeftOn();
	void moveForwardOff();
	void moveBackwardOff();
	void moveRightOff();
	void moveLeftOff();

	void pitchUpOn();
	void pitchDownOn();
	void pitchLeftOn();
	void pitchRightOn();
	void pitchUpOff();
	void pitchDownOff();
	void pitchLeftOff();
	void pitchRightOff();
	//set projection methods
	void setPerspectiveProjection( float FOV, float aspectRatio, float zNear, float zFar );

	//camera positioning methods
	void setPositionAndView( float x, float y, float z, float hDeg, float pDeg );
	void adjustHeadingPitch( float hRad, float pRad );
	//update camera view/position
	void update();

private:
	//create view, forward, strafe vectors from heading/pitch
	void updateView();
};

#endif;